package com.situ.struts.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import java.util.Map;

public class DataAction3 extends ActionSupport implements RequestAware, SessionAware, ApplicationAware {

    Map<String, Object> contextMap;
    Map<String, Object> sessionMap;
    Map<String, Object> applicationMap;

    @Override
    public String execute() throws Exception {
        System.out.println("DataAction3 execute().");

        sessionMap.put("request_data3", "request_data33");
        contextMap.put("session_data3", "session_data33");
        applicationMap.put("application_data3", "application_data33");
        return SUCCESS;
    }

    @Override
    public void setApplication(Map<String, Object> application) {
        this.applicationMap = application;
    }

    @Override
    public void setRequest(Map<String, Object> request) {
        this.contextMap = request;
    }

    @Override
    public void setSession(Map<String, Object> session) {
        this.sessionMap = session;
    }
}
